<template lang="pug">
    view
        component(is="TaskList" )
        BottomNavigation(:menus="menus" @nav-change="navChange")
</template>

<script>
import BottomNavigation from "@/components/colorui/bottom-navigation.vue";

export default {
  name: "app-index",

  data() {
    return {
      menus: [
        {
          id: "add-task",
          name: "添加待办",
          icon: "add",
          action: true,
        }
      ]
    };
  },

  components: { BottomNavigation },

  methods: {
    navigationToAddTask() {
      const options = { url: "/pages/task-items/index" };
      uni.navigateTo(options);
    },

    navChange(menu){
        if(menu.id === 'add-task') this.navigationToAddTask();
    }
  }
};
</script>

<style>
</style>
